package com.example.fashionshoes.pojo.po;

import com.baomidou.mybatisplus.annotation.TableField;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User {
    private Integer id;
    @NotBlank(message = "用户名不能为空",groups = Login.class)
    private String username;
    @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z]).{6,14}$",groups = Login.class,message = "密码需要在6-14位之间且必须包含数字和字母")
    private String password;
    @TableField(exist = false)
    @NotBlank(message = "确定密码不能为空",groups = Register.class)
    private String rePassword;
    /**
     * 是否为管理员
     */
    private Integer isAdmin;
    /**
     * 0冻结，1正常
     */
    private Integer status;
    private String signature;
    private String phone;
    private String email;
    private String avatar;
    private Integer score;
    public interface Login extends Default {

    }
    public interface Register extends Login{

    }
}
